<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="../../../node_modules/vue/dist/vue.js"></script>
    <script src="../../../node_modules/vuex/dist/vuex.js "></script>
    <style>
       
        
    </style>
</head>


<body>


    <div id="app">
        <h2>{{msg}}</h2>
        <counter :name="name"></counter>
    </div>



    <script>

        var  counter  ={
            template: ` <div>{{name}}<div>` ,
            //     computed:{
            //         name(){
            //             return this.$store.state.name+1 
            //         }
            //     },
                //props:  ['name']  
                props:  ["name"]
        }

        // var store = new Vuex.Store({    //两个大写
        //     state : {
        //         name:"小明123"
        //     }
        // });



        var  vm =new Vue({
            el:'#app',
          //  store,
           
            data:{
                    msg: " vuex 的使用" ,
                    name: "父子组件传值(  父组件的数据,通过bind 绑定到了子组件身上)"
            },
            components:{
                counter
            }
        })
        
    </script>

</body>
</html>